#include <REGX52.H>

void anp31_show_led0()
{
	while(1){
		if(P3_1==0)
		{
			P2_0=0;
		}
		else
		{
			P2_0=1;
		}
	}
}


void delay_10us(unsigned int ten_us){
  while(--ten_us);
}

void anp31_show_led0_always()
{
	while(1)
	{
		if(P3_1==0)
		{
			delay_10us(20000);
			while(P3_1==0);
			delay_10us(20000);
			
			P2_0=!P2_0;
		}
		
	}
}
void led_left_right(){
	P2=0xfe;
while(1)
	{
		if(P3_1==0)
		{
			delay_10us(20000);
			P2<<1;
		}
		if(P3_0==0){
			delay_10us(20000);
			P2>>1;
		}
	}
}
void main()
{
	anp31_show_led0_always();
}